package com.settlement.system.common.enums;


import com.settlement.system.common.util.common.EnumUtil;

/**
 * 描述: 报表取值字段枚举 <br>
 *
 * @author: hc <br>
 * 创建时间: 2022.07.26 10:45 <br>
 * <br>
 */
public enum SendReturnConditionEnum implements Code<String>{
    // /** 0:【INT-发退货明细】_[订单状态] */INT_SEND_RETURN_STATUS("【INT-发退货明细】_[订单状态]","om.status"),
    /** 0:【INT-发退货明细】_[发货]_[退货类型] */
    INT_SEND_RETURN_RETURN_TYPE("【INT-发退货明细】_[退货类型]","IFNULL(om.return_type,'NONE')"),
    INT_SEND_RETURN_ORDER_STATUS("【INT-发退货明细】_[订单状态]","om.order_status"),
    INT_SEND_RETURN_SEND_RETURN_DATA_RANGE("【INT-发退货明细】_[只取发退货数据]"," --@intOnlySrData "),
    INT_SEND_RETURN_126_DATA_RANGE("【INT-发退货明细】_[只取126状态店铺的数据]"," --@intOnly126Data "),
    INT_SEND_RETURN_SEND_RETURN_DATA_RANGE_RETURN("【INT-发退货明细】_[只取发退货数据]_退货"," --@intOnlySrDataReturn "),
    INT_SEND_RETURN_126_DATA_RANGE_RETURN("【INT-发退货明细】_[只取126状态店铺的数据]_退货"," --@intOnly126DataReturn "),
    /*INT_SEND_RETURN_STATUS("【INT-发退货明细】_[状态]","om.status"),
    INT_SEND_RETURN_SHARDING_FLAG("【INT-发退货明细】_[分库字段]","om.sharding_flag"),
    INT_SEND_RETURN_BUSINESS_TYPE_RETURN_IN_SOURCE("【INT-发退货明细】_([业务类型],[平台业务类型])","(om.business_type,IFNULL(om.return_in_source,0))"),*/
    /*INT_SEND_RETURN_BUSINESS_TYPE("【INT-发退货明细】_[业务类型]","om.business_type"),*/
    /*INT_SEND_RETURN_RETURN_IN_SOURCE("【INT-发退货明细】_[平台业务类型]","om.return_in_source"),*/
    //INT_SEND_RETURN__RETURN__RETURN_TYPE("【INT-发退货明细】_[退货]_[退货类型]","rem.return_type"),
    //INT_SEND_RETURN_ORDER_STATUS_RETURN_TYPE("【INT-发退货明细】_([订单状态],[退货类型])","(om.order_status,om.return_type)"),
    /** 1:【INT-仓出店店退仓报表】_[发货]_[退货方式] */
    INT_STORE_SEND_OR_RETURN_INVOICE_TYPE("【INT-仓出店店退仓报表】_[单据类型]","bd.invoice_type"),
    INT_STORE_SEND_OR_RETURN_RETURN_TYPE("【INT-仓出店店退仓报表】_[退货方式]","IFNULL(bd.return_type,'NONE')"),
    //INT_STORE_SEND_OR_RETURN__RETURN__RETURN_TYPE("【INT-仓出店店退仓报表】_[退货]_[退货方式]","bt.return_type"),
    INT_STORE_SEND_OR_RETURN_INVOICE_TYPE_RETURN_TYPE("【INT-仓出店店退仓报表】_([单据类型],[退货方式])","(bd.invoice_type,IFNULL(bd.return_type,'NONE'))"),
    BLANK("空白"," ")
    ;

    /**
     * 名称
     */
    private final String name;
    /**
     * sql
     */
    private final String sql;

    SendReturnConditionEnum(String name, String sql) {
        this.name = name;
        this.sql = sql;
    }

    public String getSql() {
        return sql;
    }

    /**
     * 获取对应的 SendReturnConditionEnum
     * @param code code
     * @return 报表取值字段枚举
     */
    public static SendReturnConditionEnum witch(String code){
        return EnumUtil.witch(code, SendReturnConditionEnum.class,null);
    }


    @Override
    public String code() {
        return name;
    }
}
